<?php	
 	header('Content-type: application/json');
	require_once( '../wp-load.php' );
	if ( isset( $_GET['code'] ) ) {
	    $code = $_GET['code'];
		global $wpdb;
		$user = null;
		if ($code != null || $code != '')
			$user = $wpdb->get_results("SELECT * FROM wp_users WHERE user_code = '".$code."'");
		if ($user != null)
			echo json_encode($user[0]);
		else
			echo json_encode(array(), JSON_FORCE_OBJECT);		    	    	    
	}
?>